package cn.iocoder.yudao.module.reading.dal.mysql.community;

import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.reading.dal.dataobject.community.CommunityUserLimitDO;
import org.apache.ibatis.annotations.Mapper;

import java.time.LocalDate;

/**
 * 社区用户频控 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface CommunityUserLimitMapper extends BaseMapperX<CommunityUserLimitDO> {

    /**
     * 查询用户在指定日期的频控记录
     */
    default CommunityUserLimitDO selectByUserIdAndTypeAndDate(Long userId, String limitType, LocalDate limitDate) {
        return selectOne(CommunityUserLimitDO::getUserId, userId,
                        CommunityUserLimitDO::getLimitType, limitType,
                        CommunityUserLimitDO::getLimitDate, limitDate);
    }

}
